
package com.tools.cleanmaster.store;

import android.content.Context;
import android.content.SharedPreferences;


public class DatabaseUpdateSharePrefManager {
    private static SharedPreferences sPrefs = null;

    private final static String PREFS_FILE = "antivirus_sdk_db_prefs";

    private static SharedPreferences initSharedPreferences(Context context) {
        if (sPrefs == null) {
            sPrefs = context.getSharedPreferences(PREFS_FILE, Context.MODE_PRIVATE);
        }
        return sPrefs;
    }

    public static void setCurDbConfigoVersion(Context context, String key, int value) {
        SharedPreferences prefs = initSharedPreferences(context);
        SharedPreferencesCompat.apply(prefs.edit().putInt(key, value));
    }

    public static int getCurDbConfigVersion(Context context, String key, int defValue) {
        SharedPreferences prefs = initSharedPreferences(context);
        return prefs.getInt(key, defValue);
    }

}
